Skip to content

fix(ci): label new PRs with pending-maintainer even without comments#709

Merged
thepagent merged 2 commits intomainfrom
fix/pending-maintainer-new-pr
May 3, 2026
Merged

fix(ci): label new PRs with pending-maintainer even without comments#709
thepagent merged 2 commits intomainfrom
fix/pending-maintainer-new-pr

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

Summary

New PRs with no human comments were never labeled pending-maintainer because the workflow required the last commenter to be the PR author. Since PR authors don't normally leave a comment after opening a PR, these PRs would sit unlabeled indefinitely.

Root Cause

// Old logic — skips when no human comments exist
if (humanComments.length === 0) continue;

This treats "no comments" as "not ready for maintainer", but the correct interpretation is "new PR awaiting first review".

Fix

// New logic — only skip when last commenter is NOT the PR author
if (humanComments.length > 0) {
  const lastCommenter = humanComments[humanComments.length - 1].user.login;
  if (lastCommenter !== pr.user.login) continue;
}
Scenario Before After
New PR, no comments ❌ skipped pending-maintainer
Last comment by author pending-maintainer pending-maintainer
Last comment by maintainer ✅ skipped ✅ skipped

Context

Discovered while reviewing PR #696 — it had pending-screening but never got pending-maintainer because the author never commented.

Discord Discussion

https://discord.com/channels/1490282656913559673/1500294765164498944

New PRs with no human comments were skipped by the pending-maintainer
workflow because it required the last commenter to be the PR author.
This meant freshly opened PRs would never get the label until the
author left a comment — which is not normal PR workflow.

Fix: treat no-human-comments as 'awaiting first review' and fall
through to add pending-maintainer. Only skip when the last human
comment is from someone other than the PR author (ball is with
contributor).
@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 3, 2026 04:49
@github-actions github-actions Bot added the pending-screening PR awaiting automated screening label May 3, 2026
shaun-agent posts screening reports as a member account (not GitHub
Bot type), so it was counted as a human commenter. This could prevent
pending-maintainer from being applied when shaun-agent was the last
commenter. Exclude it by login name alongside the existing Bot type
filter.
@thepagent thepagent merged commit e9134a0 into main May 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-maintainer pending-screening PR awaiting automated screening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants